﻿using Identity.API.Infrastructure.EntityConfigurations;
using Identity.API.Model;
using Microsoft.EntityFrameworkCore;

namespace Identity.API.Infrastructure
{

    public class UserInfoDbContext : DbContext
    {
        public DbSet<UserInfo> UserInfos => Set<UserInfo>();

        public UserInfoDbContext(DbContextOptions<UserInfoDbContext> options)
            : base(options)
        {
            // No need for change tracking.
            ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.ApplyConfiguration(new UserInfoEntityTypeConfiguration());
        }
    }
}
